<%@ taglib prefix="s" uri="/struts-tags"%>

<%
	String context = request.getContextPath();
%>
<form action="filter.llh">

	<div class="grid_4">
		<p>
			<label>Product<small></small> </label><input type="text" name="name">
		</p>
	</div>

	<div class="grid_4">
		<p>
			<label>Catalog</label>
			<s:select list="#{'0':'All','1':'Mobile','2':'Laptop' }" name="idCatalog"></s:select>
		</p>
	</div>
	<div class="grid_2">
		<p>
			<label>&nbsp;</label> <input type="submit" value="Filter" />
		</p>
	</div>
</form>

<div class="grid_3" style="float: right;">
	<p>
		<label>&nbsp;</label>
		<form action="newProduct.llh">
			<input style="float: right;" type="submit" value="+ New Product" />
		</form>
	</p>
</div>

<div class="grid_16">
	<table>
		<thead>
			<tr>
				<th>No.</th>
				<th>Image</th>
				<th>Product</th>
				<th>Catalog</th>
				<th colspan="2" width="10%">Actions</th>
			</tr>
		</thead>
		<tfoot>
			<tr>
				<td colspan="6" class="pagination"><span class="active curved">1</span><a
					href="#" class="curved">2</a><a href="#" class="curved">3</a><a
					href="#" class="curved">4</a> ... <a href="#" class="curved">10
						million</a></td>
			</tr>
		</tfoot>
		<tbody>
			<s:iterator value="products" status="stat">
				<tr>
					<td><s:property value="#stat.count" />
					</td>
					<td><img alt="<s:property value='name'/>"
						src="<%=context%>/<s:property value='images.get(0).url'/> "
						width="50" height="50" border="1" /></td>
					<td><s:property value="name" /></td>
					<td><s:property value="catalog.name" /></td>
					<td>
						<%-- <s:url id="edit" action="editProduct.llh">
							<s:param name='id' value='<s:property value="id"/>'></s:param>
						</s:url> --%> <a href="#" class="edit">Edit</a>
					</td>
					<td><s:url id="delete" action="deleteProduct.llh">
							<s:param name='id' value='<s:property value="id"/>'></s:param>
						</s:url> <a href="${delete }" class="delete">Delete</a></td>
				</tr>
			</s:iterator>
		</tbody>
	</table>
</div>